package com.yantong.mapper;

import com.yantong.pojo.MarketingGroup;
import com.yantong.pojo.MarketingGroupSku;
import com.yantong.pojo.MarketingGroupSkuExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MarketingGroupSkuMapper {
    long countByExample(MarketingGroupSkuExample example);

    int deleteByExample(MarketingGroupSkuExample example);

    int deleteByProductId(Long productId);

    int deleteByProductCenterId(Long productCenterId);

    int insert(MarketingGroupSku record);

    int insertSelective(MarketingGroupSku record);

    List<MarketingGroupSku> selectByExample(MarketingGroupSkuExample example);

    int updateByExampleSelective(@Param("record") MarketingGroupSku record, @Param("example") MarketingGroupSkuExample example);

    int updateByExample(@Param("record") MarketingGroupSku record, @Param("example") MarketingGroupSkuExample example);

    MarketingGroupSku getMarketingGroupSkuByActivityId(@Param("activityId") Long productId, @Param("skuId") Long skuId);

    int changeStock(@Param("total") Integer total, @Param("activityId") Long activityId, @Param("skuId") Long skuId);

    MarketingGroupSku getSkuBySpecs(@Param("activityId") Long productId, @Param("specs") String specs);

    List<MarketingGroupSku> getSkuByActivityId(@Param("activityId") Long activityId);

    List<MarketingGroup> getMarketingGroupByProductId(Long productId);
}